Dynomotion

Group: DynoMotion Message: 12594 From: cnc_machines Date: 12/16/2015
Subject: Part Ready
Greetings,

I am making an auto loader for a CNC machine. In one thread I am picking up a part and moving it to a holding position before it is placed into the spindle. I want it to stay in this position until it gets a loading request by an M Code in my CNC program.

My question is - How do I get a loop forever thread to stop at a certain point and wait to continue until it gets an input from another thread? Does anyone have a suggestion on what the C code could look like? Is there some sort of internal memory bit I could toggle on and off for this function that is accessible across all threads?

Thanks,

Scott
Group: DynoMotion Message: 12595 From: TK Date: 12/16/2015
Subject: Re: Part Ready
Hi Scott,

KFLOP has "Virtual Bits" than can be Set/Cleared/Tested for that type of purpose.  Bits 48-63 are virtual bits.  KFLOP LED Bits 46 and 47 can also be used and have the benefit of being able to see the bit state.

You might configure an MCode Action to Set the Bit 46 to 1.

Then in C Code to hold at a certain point you could loop while the Bit is not set.  With:

while (!ReadBit(46))  ;  // wait loop while bit 46 is not set
ClearBit(46);     // Clear it for next time and to acknowledge we detected the bit was set

HTH
Regards
TK
 


On 12/16/2015 3:15 PM, cnc_machines@... [DynoMotion] wrote:
 

Greetings,

I am making an auto loader for a CNC machine. In one thread I am picking up a part and moving it to a holding position before it is placed into the spindle. I want it to stay in this position until it gets a loading request by an M Code in my CNC program.

My question is - How do I get a loop forever thread to stop at a certain point and wait to continue until it gets an input from another thread? Does anyone have a suggestion on what the C code could look like? Is there some sort of internal memory bit I could toggle on and off for this function that is accessible across all threads?

Thanks,

Scott


Group: DynoMotion Message: 12597 From: cnc_machines Date: 12/17/2015
Subject: Re: Part Ready
Thanks Tom! Exactly what I needed.

Scott
Group: DynoMotion Message: 12706 From: cnc_machines Date: 1/13/2016
Subject: Re: Part Ready
Tom,

I am using a Konnect on one of my machines. It appears to use these virtual bits for its outputs. Are the "Virtual Extended" bits fair game for this same purpose?

Thanks,

Scott
Group: DynoMotion Message: 12707 From: Tom Kerekes Date: 1/13/2016
Subject: Re: Part Ready
Hi Scott,

Yes use VirtualBitsEx+xxx where xxx is the Extended Virtual Word Number to use.  See the Konnect4Boards.c example.

Regards
TK

On 1/13/2016 7:55 AM, cnc_machines@... [DynoMotion] wrote:
 

Tom,

I am using a Konnect on one of my machines. It appears to use these virtual bits for its outputs. Are the "Virtual Extended" bits fair game for this same purpose?

Thanks,

Scott